//
//  LTBaseViewController.m
//  LearnTeacher
//
//  Created by zyl_macbookpro on 2024/4/9.
//

#import "LTBaseViewController.h"

@interface LTBaseViewController ()<UITextFieldDelegate>

@end

@implementation LTBaseViewController
- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
   
    [self renderNavBarWithBackgroundImage:[UIImage imageWithColor:LTWhiteColor] backgroundColor:LTClearColor shadowColor:nil textAttributeDic:@{NSForegroundColorAttributeName:rgba(0, 0, 0, 1),NSFontAttributeName:MFontWithSize(17)} enableScrollEdgeAppearance:YES];

}
- (void)viewWillDisappear:(BOOL)animated
{
    [super viewWillDisappear: animated];
    self.HidenNavigationBar = NO;
}

- (void)setHidenNavigationBar:(BOOL)HidenNavigationBar
{
    _HidenNavigationBar = HidenNavigationBar;
    self.navigationController.navigationBar.hidden = self.HidenNavigationBar;
}
- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = LTViewBgGray;
    [self setBackButtonIsHidden:NO];
}
- (void)backPop
{
    [self.navigationController popViewControllerAnimated:YES];
}
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
    [self endEdit];
}
- (void)endEdit
{
    [self.view endEditing:YES];
}
- (BOOL)textFieldShouldReturn:(UITextField *)textField
{
    [self endEdit];
    return YES;
}
/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
